﻿{% extends "base.html" %}
{% block head %}
<style type="text/css">
	h2{ text-align:center;color:red}
</style>
<script type="text/javascript">
	$(function(){
		if(document.getElementById("applyTable").rows.length == 1){
			$("#applyDiv").append("<h2>暂无数据</h2>");
		}
		$(".tdServerType").each(function(index){
			var type = $(this).text() == "1"?"虚拟机":"物理机";
			$(this).text(type);
		})
		$(".tdEnvironment").each(function(index){
			var type = $(this).text() == "1"?"开发环境":"测试环境";
			$(this).text(type);
		})
	})
</script>
{% endblock %}
{% block content %}
<div id="applyDiv">
<table class="table table-striped" id="applyTable">
	<tr>
		<td>申请时间</td>
		<td>服务器类型</td>
		<td>系统类型及台数</td>
		<td>使用环境</td>
		<td>申请缘由</td>
		<td>对应应用</td>
		<td>当前状态</td>
	</tr>
	{% for item in history %}
	<tr>
		<td>{{item.ApplyTime}}</td>
		<td class="tdServerType">{{item.ServerType}}</td>
		<td>SuseLinux {{item.SuseLinux}} 台，<br/>Aix {{item.Aix}} 台，<br/>Windows {{item.Windows}} 台 </td>
		<td class="tdEnvironment"{{item.Environment}}</td>
		<td>{{item.Reason}}</td>
		<td>{{item.Program}}</td>
		<td></td>
	</tr>
	{% endfor %}
</table>
</div>
{% endblock %}